home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / shadez.swf / scripts / Local / Game / Thing / CVehicle.as < prev    next >
Text File  |  2011-08-19  |  3KB  |  121 lines

  1. package Local.Game.Thing
  2. {
  3.    import Local.Game.World.CAngle;
  4.    import Local.Game.World.CPosition;
  5.    import Local.Math.CRandom;
  6.    import flash.geom.Point;
  7.    
  8.    public class CVehicle extends CThingSprite
  9.    {
  10.        
  11.       
  12.       var mNode:CNode;
  13.       
  14.       public function CVehicle(param1:CPosition)
  15.       {
  16.          if(true)
  17.          {
  18.             super();
  19.             if(true)
  20.             {
  21.                mBaseType = "vehicle";
  22.                if(true)
  23.                {
  24.                   mAngle = new CAngle();
  25.                   if(true)
  26.                   {
  27.                      mPosition = param1;
  28.                      if(true)
  29.                      {
  30.                         mDelta = new CPosition();
  31.                         mRandom = new CRandom(nID);
  32.                      }
  33.                      zDepth = 100;
  34.                   }
  35.                   mMaxLife = mLife = 500;
  36.                }
  37.                mShowOnMap = true;
  38.             }
  39.             MapAdd();
  40.          }
  41.       }
  42.       
  43.       override public function AffectByExplosion(param1:CThingAffect) : Boolean
  44.       {
  45.          if(true)
  46.          {
  47.             if(super.AffectByExplosion(param1))
  48.             {
  49.                if(true)
  50.                {
  51.                   Explode();
  52.                   if(true)
  53.                   {
  54.                      AddSound("vehicle_explosion",Vehicle_Explosion_2);
  55.                   }
  56.                   PlaySound("vehicle_explosion");
  57.                }
  58.                return true;
  59.             }
  60.          }
  61.          return false;
  62.       }
  63.       
  64.       public function CompileNodes() : void
  65.       {
  66.          var _loc1_:Point = null;
  67.          var _loc2_:Point = null;
  68.          var _loc3_:CNode = null;
  69.          _loc1_ = mSprite.mObjects["na1"].mPosition.add(mPosition);
  70.          _loc2_ = mSprite.mObjects["na2"].mPosition.add(mPosition);
  71.          _loc3_ = new CNode(_loc2_,this);
  72.          if(true)
  73.          {
  74.             mNode = new CNode(_loc1_,this,_loc3_);
  75.          }
  76.       }
  77.       
  78.       override public function AffectByBullet(param1:CThingAffect) : Boolean
  79.       {
  80.          if(true)
  81.          {
  82.             if(super.AffectByBullet(param1))
  83.             {
  84.                if(true)
  85.                {
  86.                   Explode();
  87.                   if(true)
  88.                   {
  89.                      AddSound("vehicle_explosion",Vehicle_Explosion_2);
  90.                   }
  91.                   PlaySound("vehicle_explosion");
  92.                }
  93.                return true;
  94.             }
  95.          }
  96.          return false;
  97.       }
  98.       
  99.       public function VehicleMove() : Boolean
  100.       {
  101.          ┬º┬ºpush(mNode);
  102.          if(true)
  103.          {
  104.             if(┬º┬ºpop().hasTraction)
  105.             {
  106.                Accelerate_Gradient(mDelta,mGradient);
  107.             }
  108.             mNode.Move(mDelta);
  109.             ┬º┬ºpush(mNode);
  110.          }
  111.          ┬º┬ºpop().Update();
  112.          if(MapMove())
  113.          {
  114.             Process_ReachedObjective();
  115.             return true;
  116.          }
  117.          return false;
  118.       }
  119.    }
  120. }
  121.